Skip to content

Applies to

net11.0, net10.0, net47, net471, net472, net48, net481

public ReactiveView(IObservable<CacheNotify<T>> stream, IEnumerable<T> snapshot, Func<T, bool> filter, in TimeSpan throttle, IScheduler scheduler)

View source (opens in a new tab)

Summary: Initializes a new instance of the ReactiveView class from a notification stream and an initial snapshot.

Parameters

NameTypeDescription
streamIObservable> (opens in a new tab)An observable sequence of cache notifications to monitor for changes. Cannot be null.
snapshotIEnumerable (opens in a new tab)An optional initial collection of items to populate the view before processing the stream. Only items matching the filter are included.
filterFunc (opens in a new tab)A predicate used to determine which items from the snapshot and stream are included in the view. Cannot be null.
in throttleTimeSpan (opens in a new tab)The time interval used to batch incoming notifications from the stream before processing.
schedulerISchedulerThe scheduler on which to observe and process batched notifications, typically used to marshal updates to the appropriate thread (such as the UI thread).

Remarks

Changes that land between taking the snapshot and subscribing are not seen, because a bare stream cannot be rebuilt. Use a constructor that takes the source when that matters.

Exceptions

TypeCondition
System.ArgumentNullException (opens in a new tab)Thrown if stream or filter is null.